#include "stdafx.h"
#include "EventHandlersFactory.h"
#include "EventHandlers.h"


EventHandlersFactory::EventHandlersFactory(Application &i_app)
  :m_app(i_app)
  {
  }

std::shared_ptr<EventHandler> EventHandlersFactory::GetInstance(const std::string &i_handler_name)
  {
  if(i_handler_name == "CreateHill")
    {
    return std::shared_ptr<EventHandler>(new CreateHillEventHandler(m_app));
    }
  if(i_handler_name == "CreateHole")
    {
    return std::shared_ptr<EventHandler>(new CreateHoleEventHandler(m_app));
    }
  if(i_handler_name == "CreateWater")
    {
    return std::shared_ptr<EventHandler>(new CreateWaterEventHandler(m_app));
    }
  if(i_handler_name == "AddWalkway")
    {
    return std::shared_ptr<EventHandler>(new AddWalkwayEventHandler(m_app));
    }
  if(i_handler_name == "AddGrass")
    {
    return std::shared_ptr<EventHandler>(new AddGrassEventHandler(m_app));
    }
  if(i_handler_name == "AddTree")
    {
    return std::shared_ptr<EventHandler>(new AddTreeEventHandler(m_app));
    }
  if(i_handler_name == "AddFerrisWheel")
    {
    return std::shared_ptr<EventHandler>(new AddFerrisWheelEventHandler(m_app));
    }
  if("AddBench" == i_handler_name)
    {
    return std::shared_ptr<EventHandler>(new AddBenchEventHandler(m_app));
    }
  if(i_handler_name == "AddBalloonsShop")
    {
    return std::shared_ptr<EventHandler>(new AddBalloonsShopEventHandler(m_app));
    }
  if (i_handler_name == "DestroyObjects")
    {
    return std::shared_ptr<EventHandler>(new DestroyObjectsEventHandler(m_app));
    }

  return nullptr;
  }